<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateFiltersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('filters', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('filter_time')->index()->comment('统计时间戳');
            $table->integer('store_id')->index()->default(0)->comment('门店id');
            $table->integer('record_recharge')->default(0)->comment('充值金额');
            $table->integer('record_send')->default(0)->comment('赠送金额');
            $table->integer('record_balance')->default(0)->comment('余额消费');
            $table->integer('record_order')->default(0)->comment('下单数量');
            $table->integer('record_goods')->default(0)->comment('卖出商品数量');
            $table->integer('record_storage')->default(0)->comment('存酒数量');
            $table->integer('record_take_away')->default(0)->comment('取酒数量');
            $table->integer('record_storage_man')->default(0)->comment('存酒人数');
            $table->integer('record_take_away_man')->default(0)->comment('取酒人数');
            $table->integer('record_pay')->default(0)->comment('总营业金额');
            $table->integer('purchase_to_material')->default(0)->comment('采购金额');
            $table->integer('goods_sell')->default(0)->comment('商品销售金额');
            $table->integer('record_room')->default(0)->comment('订房数量');
            
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('filters');
    }
}
